﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using DWF.Studio.BaseService.Contract;
using DWF.Studio.BaseService.Contract.Plugin;
using DWF.Studio.BaseService.Contract.Studio;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DWF.Studio.BaseService
{
    /// <summary>
    /// 基础服务管理类，提供studio基础功能。如网络，呼叫主界面，呼叫插件等。
    /// </summary>
    internal class BaseServiceManager
    {
        private static readonly BaseServiceManager _baseServiceManager = new BaseServiceManager();

        static BaseServiceManager()
        {
            _baseServiceManager._baseServiceDic.Add(typeof(IPluginService).FullName, new PluginService());
            _baseServiceManager._baseServiceDic.Add(typeof(IDesignerService).FullName, new DesignerService());
            _baseServiceManager._baseServiceDic.Add(typeof(IWindowService).FullName, new WindowService());
            _baseServiceManager._baseServiceDic.Add(typeof(IProjectService).FullName, new ProjectService());
        }

        /// <summary>
        /// 管理类引用
        /// </summary>
        public static BaseServiceManager Instance
        {
            get
            {
                return _baseServiceManager;
            }
        }

        private Dictionary<string, IBaseService> _baseServiceDic =new Dictionary<string, IBaseService>();

        /// <summary>
        /// 基础服务字典
        /// </summary>
        public Dictionary<string, IBaseService> BaseServiceDic
        {
            get
            {
                return _baseServiceDic;
            }
        }
    }
}
